<div id="buttons"></div>
<script type="text/javascript">
	$(function(){
		configuraListBtn();
	})
	
	function configuraListBtn(){
		$.ajax({
			url:"/commandClass/checkAvailableLetter/",
			type:"get",
			dataType:"json",
			success:function(data){
				if(data.myHashMap.canNew){
					$("#buttons").loadButtons(['new'],{'new':{'event':aftSub}});
				}
			}
		});		
	}
	function aftSub(){
		window.location.href = "/commandClass/-1";
	}
	
</script>